package com.kichina.parking.module.message.socket.bean;

import java.io.Serializable;

/**
 * @author Surging
 * @version 1.0
 * @ClassName BaseResponse
 * @date 2022-06-17 17:21
 * @desc
 */
public class BaseSocketResponse implements Serializable {

    private String service;

    private String message;

    private Integer result_code;

    private String order_id;

    private String orderid;

    private String recordid;

    private String rule_id;

    private Integer mobilechargeid;


    @Override
    public String toString() {
        return "BaseSocketResponse{" +
                "service='" + service + '\'' +
                ", message='" + message + '\'' +
                ", result_code=" + result_code +
                ", order_id='" + order_id + '\'' +
                ", orderid='" + orderid + '\'' +
                ", recordid='" + recordid + '\'' +
                ", rule_id='" + rule_id + '\'' +
                '}';
    }


    public BaseSocketResponse(String service, int result_code, String message) {
        this.service = service;
        this.message = message;
        this.result_code = result_code;
    }

    public BaseSocketResponse(String service, int result_code, String message, String order_id) {
        this.service = service;
        this.message = message;
        this.result_code = result_code;
        this.order_id = order_id;
    }

    public BaseSocketResponse(int result_code, String service,  String message, String rule_id) {
        this.result_code = result_code;
        this.service = service;
        this.message = message;
        this.rule_id = rule_id;
    }


    public BaseSocketResponse(String service, int result_code, String message, String orderid, String order_id) {
        this.service = service;
        this.message = message;
        this.result_code = result_code;
        this.orderid = orderid;
        this.order_id = order_id;
    }

    public BaseSocketResponse(String service, String message, int result_code, String recordid) {
        this.service = service;
        this.message = message;
        this.result_code = result_code;
        this.recordid = recordid;
    }

    public BaseSocketResponse(String service, String message, Integer result_code, String order_id, Integer mobilechargeid) {
        this.service = service;
        this.message = message;
        this.result_code = result_code;
        this.order_id = order_id;
        this.mobilechargeid = mobilechargeid;
    }

    /**
     * @author Surging
     * @Description Socket 认证成功返回消息
     * @Return com.kichina.parking.module.message.socket.bean.BaseResponse
     * @date 17:44 2022-06-17
     **/
    public static BaseSocketResponse buildAuthSuccess(){
        return new BaseSocketResponse("checkKey", 0, "认证成功");
    }

    /**
     * @param message 认证失败原因
     * @author Surging
     * @Description
     * @Return com.kichina.parking.module.message.socket.bean.BaseSocketResponse
     * @date 17:39 2022-09-15
     **/
    public static BaseSocketResponse buildAuthFailed(String message){
        return new BaseSocketResponse("checkKey", 1, message);
    }

    /**
     * @author Surging
     * @Description 心跳回复成功
     * @Return com.kichina.parking.module.message.socket.bean.BaseSocketResponse
     * @date 17:39 2022-09-15
     **/
    public static BaseSocketResponse buildHeartSuccess(){
        return new BaseSocketResponse("heartbeat", 0, "在线");
    }

    /**
     * @param service 接口名称
     * @param orderId 订单记录号
     * @author Surging
     * @Description 上传业务处理失败常用方法
     * @Return com.kichina.parking.module.message.socket.bean.BaseSocketResponse
     * @date 17:41 2022-09-15
     **/
    public static BaseSocketResponse buildFailed(String service, String orderId){
        return new BaseSocketResponse(service, 1, "上传失败", orderId);
    }

    public static BaseSocketResponse buildFailed(String service, String order_id, Integer mobilechargeid){
        return new BaseSocketResponse(service, "上传失败", 1, order_id, mobilechargeid);
    }

    public static BaseSocketResponse buildFailedRecordId(String service, String recordId){
        return new BaseSocketResponse(service, "上传失败", 1, recordId);
    }

    public static BaseSocketResponse buildFailedRuleId(String service, String ruleId){
        return new BaseSocketResponse(1,service, "上传失败",  ruleId);
    }
    /**
     * @param service 接口名称
     * @param orderId 订单记录号
     * @author Surging
     * @Description 上传业务处理成功常用方法
     * @Return com.kichina.parking.module.message.socket.bean.BaseSocketResponse
     * @date 17:41 2022-09-15
     **/
    public static BaseSocketResponse buildSuccess(String service, String orderId){
        return new BaseSocketResponse(service, 0, "上传成功", orderId);
    }

    public static BaseSocketResponse buildSuccessRecordId(String service, String recordId){
        return new BaseSocketResponse(service, "上传成功", 0, recordId);
    }

    public static BaseSocketResponse buildSuccessRuleId(String service, String ruleId){
        return new BaseSocketResponse(0,service, "上传成功",  ruleId);
    }

    public static BaseSocketResponse buildSuccess(String service, String order_id, Integer mobilechargeid){
        return new BaseSocketResponse(service, "上传成功",0 , order_id, mobilechargeid);
    }

    public static BaseSocketResponse buildSuccessNoOrderId(String service){
        return new BaseSocketResponse(service, 0, "上传成功");
    }

    public static BaseSocketResponse buildFailedNoOrderId(String service){
        return new BaseSocketResponse(service, 1, "上传失败");
    }

    public static BaseSocketResponse buildSuccessOrderId(String service, String orderId){
        return new BaseSocketResponse(service, 0, "上传成功", orderId, null);
    }

    public static BaseSocketResponse buildFailedOrderId(String service, String orderId){
        return new BaseSocketResponse(service, 1, "上传失败", orderId, null);
    }

    public String getOrderid() {
        return orderid;
    }

    public void setOrderid(String orderid) {
        this.orderid = orderid;
    }

    public String getRecordid() {
        return recordid;
    }

    public void setRecordid(String recordid) {
        this.recordid = recordid;
    }

    public String getRule_id() {
        return rule_id;
    }

    public void setRule_id(String rule_id) {
        this.rule_id = rule_id;
    }

    public String getService() {
        return service;
    }

    public void setService(String service) {
        this.service = service;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public int getResult_code() {
        return result_code;
    }

    public void setResult_code(int result_code) {
        this.result_code = result_code;
    }

    public String getOrder_id() {
        return order_id;
    }

    public void setOrder_id(String order_id) {
        this.order_id = order_id;
    }

    public void setResult_code(Integer result_code) {
        this.result_code = result_code;
    }

    public Integer getMobilechargeid() {
        return mobilechargeid;
    }

    public void setMobilechargeid(Integer mobilechargeid) {
        this.mobilechargeid = mobilechargeid;
    }
}
